package restdom.dao.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Configures cascade processing for a javabean property (used by iBATIS generic
 * Dao).
 * <p>
 * CascadeWrite processing is meant for write operation (READ, UPDATE and
 * DELETE).
 * <p>
 * Use this annotation type on the field holding the javabean property.
 * <p>
 * You can customize collection property processing for all operations (value()
 * element) or only for specific operations using create(), update() or delete()
 * elements.
 */
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@Inherited
public @interface CascadeWrite {

	CollectionMode value() default CollectionMode.ELEMENTS;

	CollectionMode createCollection() default CollectionMode.ELEMENTS;

	CollectionMode updateCollection() default CollectionMode.ELEMENTS;

	CollectionMode deleteCollection() default CollectionMode.ELEMENTS;

}
